package myky.com.doctorapp.model

import com.xiangyao.train.utils.RxScedulerHelper

import io.reactivex.Observable
import myky.com.doctorapp.api.ApiManager
import myky.com.doctorapp.base.BaseEntity
import myky.com.doctorapp.contract.FollowDoctorListContract
import myky.com.doctorapp.entity.FollowDoctorEntity
import myky.com.doctorapp.utils.Constants
import myky.com.doctorapp.utils.RequestBodyBuilder

/**
 * Description:
 *
 * @author wuyangwuyang
 * Created by 2019/3/18 on 17:11
 */
class FollowDoctorListModel : FollowDoctorListContract.Model {
    override fun getFollowDoctorList(current: Int): Observable<BaseEntity<List<FollowDoctorEntity.DataBean>>> {

        val requestBodyBuilder = RequestBodyBuilder.Builder()
        val build = requestBodyBuilder.params("version", Constants.CURRENTVERSION)
                .params("size", Constants.DEFAULTSIZE)
                .params("current", current.toString())
                .build()
        return ApiManager.getApistore().getFollowDoctorList(build).compose(RxScedulerHelper.io_main())
    }
}
